
 
#include "stm8lrtc_module.h"

 

/**
* @brief  Fills each RTC_InitStruct member with its default value
*         Hour format = 24h / Prescalers configured to their reset values.
* @param  RTC_InitStruct: pointer to a RTC_InitTypeDef structure which will be
*         initialized.
* @retval None
*/
void RTC_StructInit_px(void)
{
  /* Initialize the RTC_HourFormat member */
  RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;

  /* Initialize the RTC_AsynchPrediv member */
  RTC_InitStruct.RTC_AsynchPrediv = RTC_APRER_RESET_VALUE;

  /* Initialize the RTC_SynchPrediv member */
  RTC_InitStruct.RTC_SynchPrediv = RTC_SPRERL_RESET_VALUE;
}
/**
* @brief  Fills each RTC_TimeStruct member with its default value
*         (Time = 00h:00min:00sec).
* @param  RTC_TimeStruct: pointer to a @ref RTC_TimeTypeDef structure which will be
*         initialized.
* @retval None
*/
void RTC_TimeStructInit_px(void)
{
  /* Time = 00h:00min:00sec*/
  RTC_TimeStruct.RTC_H12 = RTC_H12_AM;
  RTC_TimeStruct.RTC_Hours = 0;
  RTC_TimeStruct.RTC_Minutes = 0;
  RTC_TimeStruct.RTC_Seconds = 0;
}
/**
* @brief  Fills each RTC_DateStruct member with its default value
*         (Monday 01 January xx00).
* @param  RTC_DateStruct: pointer to a @ref RTC_DateTypeDef structure which will be
*         initialized.
* @retval None
*/
void RTC_DateStructInit_px(void)
{
  /* * (Monday 01 January xx00)*/
  RTC_DateStruct.RTC_WeekDay = RTC_Weekday_Monday;
  RTC_DateStruct.RTC_Date = 1;
  RTC_DateStruct.RTC_Month = RTC_Month_January;
  RTC_DateStruct.RTC_Year = 0x12;
}
/**
* @brief  Fills each RTC_AlarmStruct member with its default value
*         (Time = 00h:00mn:00sec / Date = 1st day of the month/Mask =
*         all fields are masked).
* @param  RTC_AlarmStruct: pointer to a @ref RTC_AlarmTypeDef structure which
*         will be initialized.
* @retval None
*/
#ifdef _OPT
void RTC_AlarmStructInit(void)
{
  /* Alarm Time Settings : Time = 00h:00mn:00sec */
  RTC_AlarmStruct.RTC_AlarmTime.RTC_H12 = RTC_H12_AM;
  RTC_AlarmStruct.RTC_AlarmTime.RTC_Hours = 0;
  RTC_AlarmStruct.RTC_AlarmTime.RTC_Minutes = 0;
  RTC_AlarmStruct.RTC_AlarmTime.RTC_Seconds = 0;

  /* Alarm Date Settings : Date = 1st day of the month*/
  RTC_AlarmStruct.RTC_AlarmDateWeekDaySel = RTC_AlarmDateWeekDaySel_Date;
  RTC_AlarmStruct.RTC_AlarmDateWeekDay = 1;

  /* Alarm Masks Settings : Mask =  all fields are masked*/
  RTC_AlarmStruct.RTC_AlarmMask = RTC_AlarmMask_All;
}
#endif